<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Insert title here</title>

<script src="../js/jquery.min.js?v=2.1.4"></script>

</head>
<body>

	<span>表名: </span>
	<select id="myTables">
		<option th:each="collect,iterStat : ${mytables}" th:text="${collect}" th:value="${collect}">
		</option>
	</select>
	<span>是否生成页面: </span>
	<select id="myHtml">
		<option value="true">是</option>
		<option value="false">否</option>
	</select>

	<input type="button" value="生成" onclick="createGener()"/>

	<script type="text/javascript">
		
	function createGener(){
		var tablex_ = $("#myTables").val();
		var myHtml_ = $("#myHtml").val();
		$.ajax({
	      url: "http://localhost:4004/gener/create",
	      data: {tablex:tablex_,myHtml:myHtml_},
	      dataType: "json",
	      method: "POST",
	      header: {
	        'content-type': 'application/x-www-form-urlencoded'
	      },
	      success: function (res) {
	    	  if(res.flag){
	    		  alert("生成成功！")
	    	  }else{
	    		  alert("生成失败！")
	    	  }
	      },
	      fail: function (err) {
	        reject(err)
	        console.log("failed")
	      }
	    });
	}
	
		
	</script>
	
</body>
</html>